1 <?php
2 session_start();
3 include(
'includes/config.php');
4 if
(isset($_POST['login']))
5 {
6 $uname=$_POST[
'username'];
7 $password=md5($_POST[
'password']);
8 $sql =
"SELECT UserName,Password FROM admin WHERE UserName=:uname and Password=:password";
9 $query= $dbh -> prepare($sql);
10 $query-> bindParam(
':uname', $uname, PDO::PARAM_STR);
11 $query-> bindParam(
':password', $password, PDO::PARAM_STR);
12 $query-> execute();
13 $results=$query->fetchAll(PDO::FETCH_OBJ);

14 if
($query->rowCount() > 0)
15 {
16 $_SESSION[
'alogin']=$_POST['username'];
17 echo
"<script type='text/javascript'> document.location = 'dashboard.php'; </script>";
18 }
else{
19     
20     echo
"<script>alert('Invalid Details');</script>";
21
22 }
23
24 }
25
26 ?>
27
28 <!DOCTYPE HTML>
29 <html>
30 <head>
31 <title>TMS | Admin Sign
in</title>
32 <meta name=
"viewport" content="width=device-width, initial-scale=1">
33 <meta http-equiv=
"Content-Type" content="text/html; charset=utf-8" />
34 <script type=
"application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
35 <!-- Bootstrap Core CSS -->
36 <link href=
"css/bootstrap.min.css" rel='stylesheet' type='text/css' />
37 <!-- Custom CSS -->
38 <link href=
"css/style.css" rel='stylesheet' type='text/css' />
39 <link rel=
"stylesheet" href="css/morris.css" type="text/css"/>
40 <!-- Graph CSS -->
41 <link href=
"css/font-awesome.css" rel="stylesheet">
42 <link rel=
"stylesheet" href="css/jquery-ui.css">
43 <!-- jQuery -->
44 <script src=
"js/jquery-2.1.4.min.js"></script>
45 <!--
//jQuery -->
46 <link href=
'//fonts.googleapis.com/css?family=Roboto:700,500,300,100italic,100,400' rel='stylesheet' type='text/css'/>
47 <link href=
'//fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>
48 <!-- lined-icons -->
49 <link rel=
"stylesheet" href="css/icon-font.min.css" type='text/css' />
50 <!--
//lined-icons -->
51 </head>
52 <body>
53     <div
class="main-wthree">
54     <div
class="container">
55     <div
class="sin-w3-agile">
56         <h2>Sign In</h2>
57         <form method=
"post">
58             <div
class="username">
59                 <span
class="username">Username:</span>
60                 <input type=
"text" name="username" class="name" placeholder="" required="">
61                 <div
class="clearfix"></div>
62             </div>
63             <div
class="password-agileits">
64                 <span
class="username">Password:</span>
65                 <input type=
"password" name="password" class="password" placeholder="" required="">
66                 <div
class="clearfix"></div>
67             </div>
68             
69             <div
class="login-w3">
70                     <input type=
"submit" class="login" name="login" value="Sign In">
71             </div>
72             <div
class="clearfix"></div>
73         </form>
74                 <div
class="back">
75                     <a href=
"../index.php">Back to home</a>
76                 </div>
77                 
78     </div>
79     </div>
80     </div>
81 </body>
82 </html>


Gõ tìm kiếm nhanh...